import Vue from 'vue'
import VueRouter from 'vue-router'
import Frame from '../views/Frame.vue'
// 导入员工花名组件 
import EmployeeName from '../components/EmployeeName.vue'
// 引入员工考勤列表组件
import Attendance from '../components/attendance/index.vue'
// 引入员工考勤记录组件
import Calendar from '../components/attendance/calendar.vue'
// 导入工资组件
import Salary from '../views/Salary.vue'
// 导入员工入职名单组件
import Employment from '../views/Employment.vue'
// 导入员工转正名单组件
import Worker from '../views/Worker.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'frame',
    component: Frame,
    redirect: 'employeename',
    children: [
      // 员工花名
      {
        path: '/employeename',
        name: 'employeename',
        component: EmployeeName,
        meta: {
          title: '员工花名',
        }
      },
      // 员工考勤模块路由信息
      {
        path: '/attendance',
        name: 'attendance',
        meta: { istrun: true },
        component: Attendance
      },
      // 考勤记录
      {
        path: '/calendar',
        name: 'calendar',
        meta: { istrun: true },
        component: Calendar
      },
      {
        // 工资组件
        path: '/salary',
        name: 'salary',
        meta: { istrun: true },
        component: Salary
      },
      {
        // 员工入职名单组件
        path: '/employment',
        name: 'employment',
        meta: { istrun: true },
        component: Employment,
      },
      {
        // 转正名单组件
        path: '/worker',
        name: 'worker',
        meta: { istrun: true },
        component: Worker,
      }
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
